#include<bits/stdc++.h>
#define int long long
#define rep(i,a,b) for(int i(a);i<=(b);++i)
#define req(i,a,b) for(int i(a);i>=(b);--i)
#define sort stable_sort
using namespace std;
char buf[1<<23],*p1=buf,*p2=buf;
#define getchar() (p1==p2&&(p2=(p1=buf)+fread(buf,1,1<<23,stdin),p1==p2)?EOF:*p1++)
template<typename TP> inline TP read(TP &num)
{
	TP x=0;
	int f=0;
	char ch=getchar();
	while(ch<48||ch>57) f|=ch=='-',ch=getchar();
	while(48<=ch&&ch<=57) x=(x<<1)+(x<<3)+(ch^48),ch=getchar();
	return num=f?-x:x;
}
template<typename ...Args> inline void read(Args &...args)
{
	(read(args),...);
}
template<typename TP> inline void write(TP x)
{
	(x<0)?(putchar('-'),x=-x):0;
	(x>9)?(write(x/10),0):0;
	putchar((x%10)^48);
}
template<typename TP> inline void writeln(TP x)
{
	write<TP>(x);
	puts("");
}
struct dsu
{
	vector<int> fa,siz;
	dsu(int n):fa(n),siz(n,1){iota(fa.begin(),fa.end(),0);}
	int find(int x){return fa[x]==x?x:fa[x]=find(fa[x]);}
	inline void unite(int x,int y){x=find(x),y=find(y);if(x!=y)fa[x]=y;}
};
signed main()
{
	freopen("travel.in","r",stdin);
	freopen("travel.out","w",stdout);
	//freopen("travel.err","w",stderr);
	int n,m,kk; read(n,m,kk);
	if(kk==1) return puts("0"),0;
	vector<vector<int>> g(n+1);
	dsu d(n+1);
	rep(i,1,m)
	{
		int x,y; read(x,y);
		g[x].push_back(y),g[y].push_back(x);
		d.unite(x,y);
	}
	vector<int> tmp(kk),imp(n+1);
	for(auto &x:tmp) read(x),imp[x]=1;
	vector<vector<int>> sign(n+1);
	set<int> _all;
	rep(i,1,n)
	{
		int anc=d.find(i);
		_all.emplace(anc);
		if(imp[i]) sign[anc].push_back(i);
	}
	vector<int> all(_all.begin(),_all.end());
	int ans=0;
	vector<vector<int>> plan;
	auto get_path=[&](int src,int dest)
	{
		queue<int> q; q.push(src);
		unordered_map<int,bool> vis;
		vector<int> p={src}; int fin=0;
		function<void(int,vector<int>&)> dfs=[&](int cur,vector<int> &p)->void
		{
			if(cur==dest) {fin=1;return;}
			vis[cur]=1;
			for(auto nxt:g[cur]) if(!vis[nxt])
			{
				p.push_back(nxt);
				dfs(nxt,p);
				if(fin) return;
				p.pop_back();
			}
		}; dfs(src,p);
		return make_pair(p,p[0]==src&&p.back()==dest);
	};
	auto c=[&](int x,int y){return x*(n+1)+y;};
	auto get_path_exclusive=[&](int src,int dest,vector<int> excluded)
	{
		queue<int> q; q.push(src);
		unordered_map<int,bool> vis;
		unordered_map<int,bool> edge_vis;
		rep(i,0,(int)excluded.size()-2) edge_vis[c(excluded[i],excluded[i+1])]=edge_vis[c(excluded[i+1],excluded[i])]=1;
		vector<int> p={src}; int fin=0;
		function<void(int,vector<int>&)> dfs=[&](int cur,vector<int> &p)->void
		{
			if(cur==dest) {fin=1;return;}
			vis[cur]=1;
			for(auto nxt:g[cur]) if(!vis[nxt]&&!edge_vis[c(cur,nxt)])
			{
				p.push_back(nxt);
				dfs(nxt,p);
				if(fin) return;
				p.pop_back();
			}
		}; dfs(src,p);
		return make_pair(p,p[0]==src&&p.back()==dest);
	};
	for(auto v:all)
	{
		int k=sign[v].size();
		if(k<=1) ;
		else if(k<=3)
		{
			++ans;
			plan.push_back(get_path(sign[v][0],sign[v][1]).first);
		}
		else if(k==4)
		{
			int add=0,added=0;
			rep(i,0,2) if(!added) rep(j,i+1,3)
			{
				auto [vec,stat]=get_path(sign[v][i],sign[v][j]);
				if(!stat) continue;
				set<int> p={0,1,2,3}; p.erase(i),p.erase(j);
				int ii=*p.begin(),jj=*p.rbegin();
				add=max(add,1ll);
				auto [vec2,stat2]=get_path_exclusive(sign[v][ii],sign[v][jj],vec);
				if(!stat2) continue;
				add=2,plan.push_back(vec),plan.push_back(vec2),added=1; break;
			}
			ans+=add;
		}
		else if(k==5)
		{
			int add=0,added=0;
			rep(i,0,3) if(!added) rep(j,i+1,4)
			{
				auto [vec,stat]=get_path(sign[v][i],sign[v][j]);
				if(!stat) continue;
				set<int> p={0,1,2,3,4}; p.erase(i),p.erase(j);
				add=max(add,1ll);
				vector<int> pp(p.begin(),p.end());
				int found=0;
				rep(ii,0,1) if(!found) rep(jj,ii+1,2)
				{
					auto [vec2,stat2]=get_path_exclusive(sign[v][ii],sign[v][jj],vec);
					if(!stat2) continue;
					found=1,add=2,plan.push_back(vec),plan.push_back(vec2),added=1;break;
				}
				if(!found) continue;
				added=1; break;
			}
			ans+=add;
		}
		else throw "Unimplemented";
	}
	writeln(ans);
	for(auto v:plan)
	{
		write(v.size()),putchar(32);
		for(auto x:v) write(x),putchar(32);
		putchar(10);
	}
	return 0;
}
